Logic gates
![Alt text](../10.1 Boolean Logic/image.png)
NOT gate
Description
- The output, X, is 1 if the input A is NOT 1
How to write this
- X = NOT A (logic notation)
(Boolean algebra)
Truth table
Input | Output |
---|---|
A | X |
0 | 1 |
1 | 0 |
AND gate
Description
- The output, X, is 1 if input A is 1 and input B is 1
How to write this
- X = A AND B (logic notation)
(Boolean algebra)
Truth table
Input | Input | Output |
---|---|---|
A | B | X |
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
OR gate
Description
- The output, X, is 1 if input A is 1 or input B is 1.
How to write this
X = A OR B (logic notation)
(Boolean algebra)
Truth table
Input | Input | Output |
---|---|---|
A | B | X |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
NAND gate
Description
- The output, X, is 1 if input A is NOT 1 or input B is NOT 1.
How to write this
X = A NAND B (logic notation)
(Boolean algebra)
Truth table
Input | Input | Output |
---|---|---|
A | B | X |
0 | 0 | 1 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
NOR gate
Description
- The output, X, is 1 if: input A is NOT 1 and input B is NOT 1
How to write this
X = A NOR B (logic notation)
(Boolean algebra)
Truth table
Input | Input | Output |
---|---|---|
A | B | X |
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 0 |
XOR gate
Description
- The output, X, is 1 if (input A is 1 AND input B is NOT 1) OR (input A is NOT 1 AND input B is 1)
How to write this
- X = A XOR B (logic notation)
(Boolean algebra)
(Note: this is sometimes written as:
Truth table
Input | Input | Output |
---|---|---|
A | B | X |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |